﻿@using Mangix.Mapping.SysDomain
@model IEnumerable<SysDomainMapping>

@using (Html.BeginRouteForm("editDomain", FormMethod.Post, new { @class = "form-horizontal", id = "formDomain", onsubmit = "return false;" }))
{
    @Html.AntiForgeryToken()
    SysDomainMapping wap = null,app =null;
    if (Model != null && Model.Any())
    {
        wap = Model.FirstOrDefault(o => o.DomainType == (int)EnumDomainType.移动端);
        app = Model.FirstOrDefault(o => o.DomainType == (int)EnumDomainType.APP接口);
    }

    <div class="form-group">
        <label class="col-sm-2 control-label no-padding-right" for="form-field-username">Wap域名</label>
        <div class="col-sm-3"> 
            <input type="text" name="wapDomain" class="form-control" value="@(wap?.Domain)" />
            @Html.ValidationMessage("wapDomain")
        </div>
    </div>
    <div class="space-4"></div>
        <div class="form-group">
            <label class="col-sm-2 control-label no-padding-right" for="form-field-username">APP接口</label>
            <div class="col-sm-3"> 
                <input type="text" name="appDomain" class="form-control" value="@(app?.Domain)" />
                @Html.ValidationMessage("appDomain")
            </div>
        </div>
        <div class="clearfix form-actions">
            <div class="col-md-offset-2 col-md-9">
                <button class="btn btn-info" type="submit">
                    <i class="ace-icon fa fa-check bigger-110"></i>
                    保存
                </button>
            </div>
        </div>
}
<script>
    $(function () {
        $('#formDomain').submit(function () {
            if ($(this).valid()) { 
                $(this).ajaxSubmit(function (data) {
                    $.modal.gritter(data);
                });
            }
        });
    });
</script>




























